package com.cinorecycle.utils;

import cn.hutool.setting.dialect.Props;

public class ConfigurationUtils {

    private static Props props;
    static {
        String path = getPath();
         props = new Props(path+"/configuration.properties");
    }

    public static Props getProps(){
        return props;
    }


    public static String getPath()
    {
        String path = ConfigurationUtils.class.getProtectionDomain().getCodeSource().getLocation().getPath();
        if(System.getProperty("os.name").contains("dows"))
        {
            path = path.substring(1,path.length());
        }
        if(path.contains("jar"))
        {
            path = path.substring(0,path.lastIndexOf("."));
            return path.substring(0,path.lastIndexOf("/"));
        }
        return path.replace("target/classes/", "");
    }

}
